﻿// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "pch.h"
#include"mytest.h";
#define DllExport   __declspec( dllexport )
BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

extern "C" DllExport int add(int a,int b)
{
    return a + b;
}

extern "C" DllExport TestData* GetTestData()
{
    int x = 20;
    int y = 30;
    TestData *testdata= new TestData;
    testdata->a = 20;
    testdata->b = 30;
    return testdata;
}

extern "C" DllExport void GetTestDataRef(TestData& testData)
{
    int x = 20;
    int y = 30;
    testData.a = 666;
    testData.b = 2323;
}

